home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / graphic / pbmpl91d.zip / PBMPLUS / MAN / PPMFORGE.MAN < prev    next >
Text File  |  1993-01-08  |  21KB  |  423 lines

  1.  
  2.  
  3. ppmforge(1)                Unix Programmer's Manual                ppmforge(1)
  4.  
  5.  
  6. NAME
  7.      ppmforge - fractal forgeries of clouds, planets, and starry skies
  8.  
  9. SYNOPSIS
  10.               ppmforge [-clouds] [-night] [-dimension dimen] [-hour hour] [-
  11.                                                       -----         ----
  12.               inclination|-tilt angle] [-mesh size] [-power factor] [-glaciers
  13.                                 -----         ----          ------
  14.               level] [-ice level] [-saturation sat] [-seed seed] [-stars
  15.               -----        -----               ---         ----
  16.               fraction] [-xsize|-width width] [-ysize|-height height]
  17.               --------                 -----                  ------
  18.  
  19. DESCRIPTION
  20.      ppmforge generates three kinds of ``random fractal forgeries,'' the  term
  21.      coined by Richard F. Voss of the IBM Thomas J. Watson Research Center for
  22.      seemingly realistic pictures  of  natural  objects  generated  by  simple
  23.      algorithms   embodying   randomness  and  fractal  self-similarity.   The
  24.      techniques used by ppmforge  are  essentially  those  given  by  Voss[1],
  25.      particularly the technique of spectral synthesis explained in more detail
  26.      by Dietmar Saupe[2].
  27.  
  28.      The program generates two varieties  of  pictures:  planets  and  clouds,
  29.      which  are  just  different  renderings of data generated in an identical
  30.      manner, illustrating the unity of the fractal  structure  of  these  very
  31.      different objects.  A third type of picture, a starry sky, is synthesised
  32.      directly from pseudorandom numbers.
  33.  
  34.      The generation of planets or clouds begins with  the  preparation  of  an
  35.      array  of  random  data in the frequency domain.  The size of this array,
  36.      the ``mesh size,'' can be set with the -mesh option; the larger the  mesh
  37.      the  more  realistic  the  pictures  but  the calculation time and memory
  38.      requirement increases as the  square  of  the  mesh  size.   The  fractal
  39.      dimension,  which  you can specify with the -dimension option, determines
  40.      the roughness of the terrain on the planet or the scale of detail in  the
  41.      clouds.   As  the  fractal  dimension  is  increased, more high frequency
  42.      components are added into the random mesh.
  43.  
  44.      Once the mesh is generated, an inverse two dimensional Fourier  transform
  45.      is performed upon it.  This converts the original random frequency domain
  46.      data into spatial amplitudes.  We scale the real components  that  result
  47.      from  the Fourier transform into numbers from 0 to 1 associated with each
  48.      point on the mesh.  You can further modify  this  number  by  applying  a
  49.      ``power  law  scale''  to it with the -power option.   Unity scale leaves
  50.      the numbers unmodified; a power scale of 0.5 takes the square root of the
  51.      numbers in the mesh, while a power scale of 3 replaces the numbers in the
  52.      mesh with their cubes.  Power law scaling is best envisioned by  thinking
  53.      of  the data as representing the elevation of terrain; powers less than 1
  54.      yield landscapes with vertical scarps  that  look  like  glacially-carved
  55.      valleys;  powers greater than one make fairy-castle spires (which require
  56.      large mesh sizes and high resolution for best results).
  57.  
  58.      After  these  calculations,  we  have  a  array  of  the  specified  size
  59.      containing  numbers that range from 0 to 1.  The pixmaps are generated as
  60.      follows:
  61.  
  62.      Clouds    A colour map is created that ranges from pure blue to white  by
  63.                increasing   admixture   (desaturation)  of  blue  with  white.
  64.                Numbers less than 0.5 are coloured blue,  numbers  between  0.5
  65.                and  1.0  are coloured with corresponding levels of white, with
  66.  
  67.  
  68.                                25 October 1991                               1
  69.  
  70.  
  71.  
  72. ppmforge(1)                Unix Programmer's Manual                ppmforge(1)
  73.  
  74.  
  75.                1.0 being pure white.
  76.  
  77.      Planet    The mesh is projected onto a sphere.  Values less than 0.5  are
  78.                treated  as  water and values between 0.5 and 1.0 as land.  The
  79.                water areas are coloured based upon the water depth,  and  land
  80.                based  on  its  elevation.   The  random depth data are used to
  81.                create clouds over the  oceans.   An  atmosphere  approximately
  82.                like   the  Earth's  is  simulated;  its  light  absorption  is
  83.                calculated to create a blue cast around the limb of the planet.
  84.                A  function  that  rises  from  0  to  1  based  on latitude is
  85.                modulated by the local elevation to generate  polar  ice  caps-
  86.                -high  altitude terrain carries glaciers farther from the pole.
  87.                Based on the position of the star with respect to the observer,
  88.                the  apparent  colour of each pixel of the planet is calculated
  89.                by ray-tracing from the star to the planet to the observer  and
  90.                applying  a  lighting model that sums ambient light and diffuse
  91.                reflection (for most planets ambient light is  zero,  as  their
  92.                primary  star  is the only source of illumination).  Additional
  93.                random data are used to generate stars around the planet.
  94.  
  95.      Night     A sequence of pseudorandom numbers is used  to  generate  stars
  96.                with a user specified density.
  97.  
  98.      Cloud pictures always contain 256 or fewer colours and may  be  displayed
  99.      on  most  colour  mapped  devices  without  further  processing.   Planet
  100.      pictures often contain  tens  of  thousands  of  colours  which  must  be
  101.      compressed  with ppmquant or ppmdither before encoding in a colour mapped
  102.      format.  If the display resolution is high  enough,  ppmdither  generally
  103.      produces  better  looking  planets.   ppmquant  tends  to create discrete
  104.      colour bands, particularly in  the  oceans,  which  are  unrealistic  and
  105.      distracting.  The number of colours in starry sky pictures generated with
  106.      the -night option depends on the value specified for -saturation.   Small
  107.      values  limit the colour temperature distribution of the stars and reduce
  108.      the number of colours in the image.  If the -saturation is set to 0, none
  109.      of  the stars will be coloured and the resulting image will never contain
  110.      more than 256 colours.  Night  sky  pictures  with  many  different  star
  111.      colours  often  look  best when colour compressed by pnmdepth rather than
  112.      ppmquant or ppmdither.  Try newmaxval settings of  63,  31,  or  15  with
  113.                                  ---------
  114.      pnmdepth to reduce the number of colours in the picture to 256 or fewer.
  115.  
  116. OPTIONS
  117.  
  118.      -clouds   Generate clouds.  A pixmap  of  fractal  clouds  is  generated.
  119.                Selecting clouds sets the default for fractal dimension to 2.15
  120.                and power scale factor to 0.75.
  121.  
  122.      -dimension dimen
  123.                 -----
  124.                Sets the fractal dimension to the specified dimen, which may be
  125.                                                            -----
  126.                any  floating  point  value  between  0  and 3.  Higher fractal
  127.                dimensions create more ``chaotic'' images, which require higher
  128.                resolution  output and a larger FFT mesh size to look good.  If
  129.                no dimension is specified, 2.4 is used when generating  planets
  130.                and 2.15 for clouds.
  131.  
  132.  
  133.  
  134.  
  135.  
  136.                                25 October 1991                               2
  137.  
  138.  
  139.  
  140. ppmforge(1)                Unix Programmer's Manual                ppmforge(1)
  141.  
  142.  
  143.      -glaciers level
  144.                -----
  145.                The floating point level setting controls the extent  to  which
  146.                                   -----
  147.                terrain elevation causes ice to appear at lower latitudes.  The
  148.                default value of 0.75 makes the polar caps  extend  toward  the
  149.                equator  across  h